﻿#ifndef USERMANAGEWIDGET_H
#define USERMANAGEWIDGET_H

#include <QWidget>
#include <QMenu>
#include "companynetworkaccessmanager.h"
#include "userrelation.h"
#include "newuserrelationwidget.h"
#include "userrelationservice.h"
#include "userrelationinfowidget.h"

namespace Ui {
class UserManageWidget;
}

class UserManageWidget : public QWidget
{
    Q_OBJECT

public:
    explicit UserManageWidget(QWidget *parent = nullptr);
    ~UserManageWidget();

    void setWidgetType(UserRelation::RelationType widgetType);

    void loadCategory();

    void loadUserRelation();

private slots:
    void on_pushButtonNew_clicked();

    void on_pushButtonInfo_clicked();

    void on_pushButtonUpdateData_clicked();

    void on_pushButtonQueryClear_clicked();

    void on_lineEditQueryOverall_textChanged(const QString &arg1);

    void on_lineEditQueryContact_textChanged(const QString &arg1);

    void on_lineEditQueryNickName_textChanged(const QString &arg1);

    void on_lineEditQueryTel_textChanged(const QString &arg1);

private:
    Ui::UserManageWidget *ui;

    UserRelation::RelationType widgetType;
    NewUserRelationWidget newUserRelationWidget;
    UserRelationInfoWidget userRelationInfoWidget;

    UserRelationService userRelationService;
};

#endif // USERMANAGEWIDGET_H
